subroutine set_mat_param(lunit)
  use param,only:avogadro
  use mat_param,only:dist_a0
  use mat_param,only:dist_r0
  use mat_param,only:half_a0
  use mat_param,only:mat_density
  use mat_param,only:atomic_no
  use mat_param,only:hosts
  use mat_param,only:ihosts
  use box_param,only:bwidth
  implicit none

  integer,intent(in) :: lunit

  if (dist_a0.eq.0) call abnormal_stop("set_mat_param",&
       "Lattice parameter is not specified.")

  half_a0=dist_a0*0.5
  dist_r0=sqrt(3.0)*half_a0

  hosts=(mat_density/atomic_no)*avogadro &
       *(bwidth(1)*bwidth(2)*bwidth(3))
  ihosts=1.0/hosts

  return

end subroutine set_mat_param
